home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / love4th.zip / L-TECH.DOC < prev    next >
Text File  |  1991-10-01  |  3KB  |  51 lines

  1. Love Forth Technical Note
  2.  
  3.         Love Forth is a Forth-83 standard programming language for the
  4. IBM PC/XT/AT and compatibles. In order to increase available memory
  5. space over the standard 64k model, it has been designed to operate over
  6. five segments.  These segments are classified by function: machine code,
  7. threaded addresses, data, stacks and dictionary heads. This modification
  8. has been performed without reducing execution speed.
  9.  
  10. Love Forth uses the usual 8086 'NEXT' instruction sequence:
  11.              LODSW    MOV BX, AX   JMP [BX]
  12.  
  13.         Since 8086 fetches instructions relative to the CS segment 
  14. register and the LODSW and JMP [BX] work relative to the DS segment 
  15. register, the first logical division was to place threaded addresses 
  16. and code addresses (parameter and code fields) into a separate segment 
  17. from the machine code. This required modification to the assembler and 
  18. some compiler words (like CREATE, DOES>, ;CODE).
  19.  
  20.         The 8086 performs all stack operations (PUSH, POP, 
  21. instructions with [BP]) relative to the SS segment register.  The next 
  22. logical division was to assign the SS register a separate segment.  
  23. Love Forth uses SP and BP registers for the parameter and return stacks 
  24. respectfully.  This modification was straightforward, the only changes 
  25. required were to some stack operators (PICK, ROLL) and to utilities 
  26. such as: .S .
  27.  
  28.         Separating dictionary heads is a valuable modification to any 
  29. Forth system.  Approximately 30% of dictionary space is saved by this 
  30. method. In Love Forth dictionary heads were moved to a segment not 
  31. relative to any specific 8086 segment register.  Any words that require 
  32. access to the head segment (WORDS, CREATE) calculate the segment value 
  33. when required.
  34.  
  35.         The last division made to the standard model was to separate 
  36. data.  This is commonly done in other Forths to allow programming into 
  37. ROM.  In Love Forth this also further reduced the space in the kernel.  
  38. The ES segment register was used to access this segment, requiring 
  39. segment override instructions in some words.
  40.  
  41.         Very few modifications were required to standard Forth source 
  42. code to run under Love Forth.  The exception was for compiler words 
  43. that directly stored threaded addresses, machine code or portions of 
  44. the dictionary headers.  Special words were added to the kernel for 
  45. this.
  46.  
  47.         There are separate dictionary pointers for code, threads, data 
  48. and head segments.  When creating a final application program, the 
  49. segments may be overlapped to the nearest paragraph and the system 
  50. saved without heads.
  51.